package com.company.structural.decorator_pattern.decorator;

import com.company.structural.decorator_pattern.component.Component;

/**
 * @ClassName ComponentDectorator
 * @Author tiezheng.han
 * @Date 2020/8/31 16:28
 **/
public class ComponentDectorator extends Component {

    /**
     * 维持对抽象构件类型对象的引用
     */
    private Component component;

    /**
     * 注入抽象对象构件类型的对象
     * @param component
     */
    public ComponentDectorator(Component component) {
        this.component = component;
    }

    @Override
    public void display() {
        component.display();
    }
}
